#ifndef _CONTROLLER_H
#define _CONTROLLER_H

#include "model.h"

//userController.c 成功(0),失败(-1)
int userController_heartKeepTask_startup(int interval);
int userController_login(char* username, char* passwd, char* errmsg);
int userController_regist(char* username,char* passwd, char* passwd2, char* errmsg);
int userController_logout(char* errmsg);
const char* userController_getLoginUsername();

//friendController.c 好友控制器
int friendController_list(friend_t** fArr,int* arrLen,char* errmsg); //返回-1发生了错误， 0-成功
int friendController_sendMsg(char* user,char* buf,char* errmsg);

int friendController_add(char* friendname, char* errmsg);
int friendController_getAddNum(char* errmsg);

//chatController.c (本地sqlite查询缓存消息)
int chatController_getUserMsg(char* username, void (*p)(msg_user_t*), char* errmsg);
int chatController_getGroupMsg(char* groupname, void (*p)(msg_group_t*), char* errmsg);
int chatController_getSysMsg(void (*p)(msg_system_t*), char* errmsg);

#endif
